<?php
/**
 * Created by leiying
 * Date: 2017/11/16
 * Time: 10:53
 */
//搜索
include_once(GZ_PATH . '/includes/common_func.php');
include_once(GZ_PATH . '/includes/search_func.php');
class searchAction extends Action
{

    /**搜索接口
     * @author leiying
     */
    public function index(){
        $page_size   = GZ_Api::$pagination['count'];    //分页设置
        $page        = GZ_Api::$pagination['page'];     //分页设置
        $search_val = _POST("search_val", "");
        $sort_type = _POST("sort_type", "all");
        $sort_action = _POST("sort_action", "all");

        $res = get_goods($search_val,$sort_type,$sort_action,$page,$page_size);
        GZ_Api::outPut($res);
    }

    /**热搜词接口
     * @author leiying
     */
    public function hot_keyword(){
        $res_data = $this->shop_config();
        $res = explode(",",$res_data["hot_keyword"]);
        GZ_Api::outPut($res);
    }


}
